Micron Document
πŸŽ–οΈGitΠ―Ρ€Π°πŸŽ–οΈ

Node / meshtastic / Meshtastic-Android / files / CONTRIBUTING.md

Displaying Rendered β€’ View raw β€’ Download

CONTRIBUTING.md renovate/coil (bacebac4) Text, 5.18 KB

Contributing to Meshtastic-Android

Thank you for your interest in contributing to Meshtastic-Android! We welcome contributions from everyone.

How to Contribute

β€’ Fork the repository and create your branch from T383838main.
β€’ Keep each change focused β€” one concern per commit.
β€’ Test your changes thoroughly before submitting a pull request.
β€’ Submit a pull request (PR) with a clear description of your changes and the problem they solve.
β€’ If you are addressing an existing issue, please reference it in your PR (e.g., T383838Fixes #123).
β€’ First-time contributors are asked to sign the CLA β€” the CLA-assistant bot will prompt you on your first PR.

Code Style

β€’ Follow the Kotlin Coding Conventions for Kotlin code.
β€’ Use Android Studio's default formatting settings.
β€’ We use spotless for automated code formatting. You can run T383838./gradlew spotlessApply to format your code automatically.
β€’ You can also run T383838./gradlew spotlessInstallGitPrePushHook -Dorg.gradle.isolated-projects=false --no-configuration-cache to install a pre-push Git hook that will run a T383838spotlessCheck.
β€’ Write clear, descriptive variable and function names.
β€’ Add comments where necessary, especially for complex logic.
β€’ Keep methods and classes focused and concise.
β€’ Strings: Use localised strings via the Compose Multiplatform Resource library in T383838:core:resources.
β€’ Do not use the legacy T383838androidApp/src/main/res/values/strings.xml.
β€’ Definition: Add strings to T383838core/resources/src/commonMain/composeResources/values/strings.xml.
β€’ Usage:
T282828
Tff7b72import T7ee787org.jetbrains.compose.resources.stringResource
Tff7b72import T7ee787org.meshtastic.core.resources.Res
Tff7b72import T7ee787org.meshtastic.core.resources.your_string_key

Te6edf3TextTb4b4b4(Te6edf3text Tff7b72= Te6edf3stringResourceTb4b4b4(Te6edf3ResTb4b4b4.Te6edf3stringTb4b4b4.Te6edf3your_string_keyTb4b4b4)Tb4b4b4)


Linting

Meshtastic-Android uses Detekt for static code analysis and linting of Kotlin code.

β€’ Run T383838./gradlew detekt before submitting your pull request to ensure your code passes all lint checks.
β€’ Fix any Detekt warnings or errors reported in your code.
β€’ Suppress individual warnings only as a last resort.
β€’ You can find Detekt configuration in the T383838config/detekt directory. If you believe a rule should be changed or suppressed, discuss it in your PR.

Testing

Meshtastic-Android uses unit tests, Robolectric JVM tests, and instrumented UI tests to ensure code quality and reliability.

β€’ Unit tests are located in the T383838src/test/ directory of each module.
β€’ Compose UI Tests (JVM) are preferred for component testing and are also located in T383838src/test/ using Robolectric.
β€’ Instrumented tests (including full E2E UI tests) are located in T383838src/androidTest/. For Compose UI, use the Jetpack Compose Testing APIs.

Guidelines for Testing

β€’ Add or update tests for any new features or bug fixes.
β€’ Ensure all tests pass by running:
β€’ T383838./gradlew test for unit and Robolectric tests (pure-Android modules)
β€’ T383838./gradlew allTests for KMP module tests (T383838core:*, T383838feature:*) β€” neither T383838test nor T383838allTests alone is sufficient; both must pass.
β€’ T383838./gradlew kmpSmokeCompile when touching any KMP module β€” compiles the non-Android targets the unit tests don't cover
β€’ T383838./gradlew connectedAndroidTest for instrumented tests
β€’ For UI components, write Robolectric Compose tests where possible for faster execution.
β€’ If your change is difficult to test, explain why in your pull request.

Pull Requests

β€’ Branches use conventional-commit style prefixes, e.g. T383838feat/<topic>:
β€’ T383838feat/ β€” new user-visible behavior
β€’ T383838fix/ β€” bug fixes
β€’ T383838chore/ β€” tooling, deps, CI, cleanup
β€’ T383838docs/ β€” documentation only
β€’ T383838build/ β€” build system changes
β€’ T383838ci/ β€” CI workflow changes
β€’ T383838refactor/ β€” code structure changes
β€’ T383838test/ β€” test additions or fixes
β€’ T383838deps/ β€” dependency updates
β€’ T383838release/* and T383838automation/* are reserved for maintainers and automated workflows.
β€’ Ensure your branch is up to date with the latest T383838main branch before submitting a PR.
β€’ Provide a meaningful title and description for your PR.
β€’ Include information on how to test and/or replicate if it is not obvious.
β€’ Include screenshots or logs if your change affects the UI or user experience.
β€’ Be responsive to feedback and make requested changes promptly.
β€’ Squash commits if requested by a maintainer.

Issue Reporting

β€’ Search existing issues before opening a new one to avoid duplicates.
β€’ Provide a clear and descriptive title.
β€’ Include steps to reproduce, expected behavior, and actual behavior.
β€’ Attach logs, screenshots, or other helpful context if applicable.

Community Standards

β€’ Be respectful and considerate in all interactions.
β€’ The Meshtastic Android project is subject to the Meshtastic code of conduct.
β€’ Help others by reviewing pull requests and answering questions when possible.

Thank you for helping make Meshtastic-Android better!

Served by rngit 1.5.4 - Generated in 0.11s